# -*- coding: utf-8 -*-
"""
Created on Tue Oct 18 21:59:47 2016

@author: zhiqiang
"""
def is_prime(num):#判断一个奇数是不是质数
    is_pri = True
    if num==3:
        return True
    for i in range(3,int(sqrt(num))+1,2):
        if num%i==0:
            return False
    return is_pri

from math import sqrt
prime_list = []   #初始化一个存放质数的列表
odd = 3
while True:
    if is_prime(odd):   #如果是质数
        prime_list.append(odd)
    else:               #如果是非质数
        is_allright = False
        for prime in prime_list:
            test = odd - prime
            temp = test//2
            sqrt_temp = int(sqrt(temp))
            if sqrt_temp**2==temp:
                is_allright=True
                break
        if not is_allright:
            print(odd)
            break
    odd += 2